<?php
namespace App\Admin\Models;
use Common\BaseModel;
class Feedbacks extends BaseModel
{
    protected $res;
    protected $redis_key="admin_";

    public function initialize()
    {
        parent::initialize();
        $this->setSource('f_feedbacks');
    }


    public function get_list($data,$method='list'){

        $page = intval($data['page']);
        $size = intval($data['limit']);
        if ($page > 0) {
            $page = ($page - 1) * $size;
        }
        $conditions = '';
        if($method == 'list'){
            $cate_list = $this->find(
                array(
                    $conditions,
                    "order"  => 'id desc',
                    'limit'  => $size,
                    'offset' => $page
                ))->toarray();
            return $cate_list;
        }else{
            $counts = $this->count(array(
                $conditions,
            ));
            return $counts;
        }
    }


}
